home *** CD-ROM | disk | FTP | other *** search
- INFOS TO BUILD PKTDRV.PRG
- =========================
-
- 256 bytes stack are sufficient for this version (RIEBL CARD PLUS).
- Turn off stack-checking.
-
- I used PURE-C to develop this driver, see the .prj file how to link all
- objects.
-
- PKTDRV.PRG adds a cookie named '_PKT', its value is a pointer to
- a jumptable. All functions use the PURE-C register parameter passing
- convention, that is, integer types in D0,D1 , pointers in A0,A1
- from first parameter to last respectively.
-
- Supported functions are:
-
- int net_info(int length_of_buffer, char *buffer);
-
- Gives information about traffic on the node.
- ( This function is not developed to its final state and is subject to
- change in the future)
- Return: negative errorcode or length of copied data.
-
- int net_open(int protocol, int (*handler)(int length,char *pkt));
-
- Tells the driver the address of a packet handler, which wants to
- receive packets of a specific ethernet protocol. Up to 5 different
- protocols are allowed at the moment (only 2 (ARP and IP) are used by
- our apps)
- Return: negative errorcode or 0 if succesful.
-
- The protocol-handler function gets the length (in D0) and the address
- (in A0) of a newly arrived packet. If the handler accepts the packet
- it returns a nonzero value, otherwise it returns zero and the packet
- driver discards the packet. Accepted packets must be freed using
- net_pktfree after processing. The protocol-handler runs on interrupt
- level, therefore no stack-checking is allowed
-
- int net_release(int protocol);
-
- Removes a protocol from the protocoltable. Any further incoming
- packets of this protocol are discarded by the packet driver.
- Return: negative errorcode or 0 if successful.
-
- int net_send(int length, char *pkt);
-
- Send a packet. The packet is sent as it is, any headers (inclusive
- ethernet header) must be filled by the caller. This function waits
- until the packet is sent or a error is returned from the chip.
- Only packets allocated by net_pktalloc or got from the protocol-
- upcall should be handed to this function.
- Return: negative errorcode or length of sent packet, if successful.
-
- (Note: The length of the sent packet may be greater than the original
- packet, since the minimum length of a ethernet packet is 60 bytes).
-
- int net_getadr(int length_of_buffer,char *addr_buffer);
-
- Fills addr_buffer with the local hardware address.
- Return: number of copied bytes or negative errorcode
-
- int net_reset(void);
-
- Reset the packet driver to a state like after startup, any active
- protocol is aborted.
- Return: 0 if successful or negative errorcode
-
- PKTBUF *net_pktalloc(u_short length_of_packet);
-
- Allocates a block of memory to hold a packet. If the interface
- provides onboard memory, it is strongly recommended to allocate
- this block onboard to avoid unneccessary copying of data.
- Return: pointer to new allocated packet or NULL if out of mem.
-
- int net_pktfree(PKTBUF *);
-
- Free a packet allocated by net_pktalloc or handed by the protocol-
- handler upcall.
- Return: 0 if successful or negative errorcode.
-
- Indices to the jumptable are provided in pktdrv.h
-
- Any suggestions would be appreciated.
-
-
- Hans Wieser
-
-
- ---
-
- Support for other Ethernet cards:
- ---------------------------------
-
- The packet driver forms the interface to any Ethernet card applied to
- your ATARI. So if you would like to use any other card than the
- RIEBL card you simply have to change this program.
- We did this for a Dlink DE600 pocket adaptor usually fitted to the
- parallel port of an IBM-PC. Since the ATARI does not provide all
- of the required signals on its parallel port, we did some simple
- interface hardware for the cartridge port. The file "adaptor.img"
- shows the principle of this piece. The packet driver for the DE600
- you can find in the file "dlinkdrv.prg".
- The file "newadapt.img" is the latest circuit drawing of our adapter.
- As the ATARI has no interrupt input on the cartridge port, we use
- the BUSY-line of the printer port (Not neccessary - only boosts performance).
- The sources for packet drivers are provided in pktdrv/pktdlink and
- pktdrv/pktlance.
-
-
- Peter Mayer
-
-
-